package com.chance.cc.crawler.prod.command.trigger.domain.commerce.tm;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.commerce.tm.TBTMPCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.tm.TianmaoH5ProductDetailCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.commerce.tm.TianmaoProductCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;


public class TMCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {


    public static void main(String[] args) {
        publishTBTMCommentScheduleTriggerInfo();
    }

    public static void publishTMCommentScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TianmaoProductCommentCrawlerScheduleJob.tmCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TianmaoProductCommentCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 0 * * ?",
                "天猫评论每天凌晨0：10点采集一次");
    }

    public static void publishTMH5ProductScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TianmaoH5ProductDetailCrawlerScheduleJob.tmCrawlerJob();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TianmaoH5ProductDetailCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 5 * * ?",
                "淘宝评论每天5:10采集一次");
    }

    public static void publishTBTMCommentScheduleTriggerInfo(){
        CrawlerJob crawlerJob = TBTMPCommentCrawlerScheduleJob.taobaoSchduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                TBTMPCommentCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 0 * * ?",
                "天猫评论每天凌晨0：10点采集一次");
    }

}
